<script setup >
import { ref } from 'vue'
import {Avatar,Lock,Hide  } from '@element-plus/icons-vue'

import axios from 'axios';
const username = ref('')
const password = ref('')




const submita = async ()=>{
  console.log("aaaaaaaaaa");
  
  let res = await axios({
    url:"http://localhost:8080/login",
    method:"POST",
    data:{
      username:username.value,
      password:password.value
    }
  })
localStorage.setItem('token',res.data.data)


  location.href = 'http://localhost:5173/system/sysUser'
}



</script>
<template>
  <div class="poaa">
     <div class="pooo">
      <h1 class="ji">a小黑子管理系统</h1>
    <el-input
      v-model="username"
      style="width: 240px"
      placeholder="账号"
      :prefix-icon="Avatar"
      
    /><br><br>
    <el-input
      v-model="password"
      style="width: 240px"
      placeholder="密码"
      type="password"
      :prefix-icon="Lock"
    show-password
     
    /><br><br>
    <el-button type="primary"  style="width: 240px" @click="submita()" >Login</el-button>
    </div>
  </div>
</template>
<style>
.poaa{
background-color: MidnightBlue;
display: flex;
justify-content: center;
height: 100vh;
align-items: center;
}
.ji{
  color:aliceblue;
    
}
</style>